package com.wardrobe.dao.shop;

import com.wardrobe.domain.common.BackEndFromBean;
import com.wardrobe.domain.shop.ShopFromBean;
import com.wardrobe.domain.shop.ShopSaveBean;
import com.wardrobe.domain.shop.ShopShowBean;
import com.wardrobe.mapper.master.shop.ShopMasterMapper;
import com.wardrobe.mapper.slave.shop.ShopSlaveMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2018/11/16.
 */
@Service
public class ShopDao {
    @Autowired
    ShopMasterMapper shopMasterMapper;
    @Autowired
    ShopSlaveMapper shopSlaveMapper;

    public ShopShowBean selectShopByUserId(long userId){
        return shopSlaveMapper.selectShopByUserId(userId);
    }

    public int insertShop(ShopSaveBean saveBean){
        return shopMasterMapper.insertShop(saveBean);
    }

    public int updateShop(BackEndFromBean fromBean){
        return shopMasterMapper.updateShop(fromBean);
    }

    public List<ShopShowBean> selectShopList(ShopFromBean fromBean){
        return shopSlaveMapper.selectShopList(fromBean);
    }

    public long countShop(ShopFromBean fromBean){
        return shopSlaveMapper.countShop(fromBean);
    }

    public ShopShowBean selectShopById(long id){
        return shopSlaveMapper.selectShopById(id);
    }
}
